package com.shujia.wyh.day06.homework.test2;

//姓名，年龄， 技术方向，工作年限, 工作单位和职务
public class ItWorker {
    private String name;
    private int age;
    private String technicalDirection;
    private int workYear;
    private String unit;
    private String job;

    public ItWorker() {
    }

    public ItWorker(String name, int age, String technicalDirection, int workYear, String unit, String job) {
        this.name = name;
        setAge(age);
        this.technicalDirection = technicalDirection;
        this.workYear = workYear;
        this.unit = unit;
        this.job = job;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        if (age >= 15) {
            this.age = age;
        } else {
            System.out.println("年龄信息无效!已修改默认年龄为15");
            this.age = 15;
        }
    }

    public String getTechnicalDirection() {
        return technicalDirection;
    }

    public int getWorkYear() {
        return workYear;
    }

    public void setWorkYear(int workYear) {
        this.workYear = workYear;
    }

    public String getUnit() {
        return unit;
    }

    public void setUnit(String unit) {
        this.unit = unit;
    }

    public String getJob() {
        return job;
    }

    public void setJob(String job) {
        this.job = job;
    }

    public void show() {
        System.out.println("姓名：" + name);
        System.out.println("年龄：" + age);
        System.out.println("技术方向：" + technicalDirection);
        System.out.println("工作年限：" + workYear);
        System.out.println("目前就职于：" + unit);
        System.out.println("职务是：" + job);
    }
}
